package edu.buaa.act.travel.m.model;

import java.util.List;

import org.json.JSONObject;

import android.util.Log;


import edu.buaa.act.travel.m.tpdl.TpdlActivity;
import edu.buaa.act.travel.m.tpdl.TripItinerary;
import edu.buaa.act.travel.m.utils.JSONParser;

public class TripDetailModel {

	private TripItinerary trip;

	public TripDetailModel(final String result) {

		final JSONObject jo = JSONParser.getJSONObject(result);
		final JSONObject jtrip= JSONParser.getJSONObject(jo, "trip");
		trip = TripItinerary.parseJSON(jtrip);
		
		Log.v("Yecol", trip.getAllActivitiesInOrder().toString());
	}

	public List<TpdlActivity> getTripDetails() {
		return trip.getAllActivitiesInOrder2();
	}
}
